import axios from "axios";

// 公网文件上传地址
const fileUploadUrl = import.meta.env.VITE_RISKE_FILE_UPLOAD_URL;
// 公网文件上传方法
const fileUploadMethod = import.meta.env.VITE_RISKE_FILE_UPLOAD_URL_METHOD;
// 公网文件上传请求头参数
const fileUploadContentType = import.meta.env.VITE_RISKE_FILE_UPLOAD_URL_ContentType;

/**
 * 文件上传
 * @param file
 * @returns {Promise<AxiosResponse<any>> | *}
 */
export function RequestRiskeFileUpload(file){
    console.log("fileUploadUrl:",fileUploadUrl);
    console.log("fileUploadMethod:",fileUploadMethod);
    console.log("fileUploadContentType:",fileUploadContentType);
    console.log("file:",file);
    return axios({
        url: fileUploadUrl,
        method: fileUploadMethod,
        headers: {
            'Content-Type': fileUploadContentType
        },
        data: {
            file: file
        }
    })
}
